<script>
//commonEffection.setFrameHeight('1000');
$(document).ready(
	function(){
		$('select[name="duration"]').val('<?=$this->itemArray[0]['duration']?>');
	}
);
function checkForm(){
	if(trim($('input[name="subject"]').val())==''){
		alert('Please input what you are searching for!');
		return false;	
	}
	if($('#flid').val()==0){
		alert('Please select the class of your wanted product!');
		return false;
	}
	if(trim($('#demand_content').val())==''){
		alert('Please input the description of your wanted product!');
		return false;
	}
	return true;
}
fenleiEffection.type='demand';
</script>
<style>
.currentDemand_<?=$this->currentAction?>{
	background:repeat-x #FFFFFF bottom;
	text-decoration: underline;
}
</style>
<div class="frame_demandDiv">
	<div class="pmflDiv">
		<li><a class="currentDemand_all" href="adminb-demand-all">&nbsp;A l l&nbsp;</a></li>
		<li><a class="currentDemand_active" href="adminb-demand-active">Active</a></li>
		<li><a class="currentDemand_ended" href="adminb-demand-ended">Ended</a></li>
		<li style="margin-left:20px"><a class="currentDemand_add" href="adminb-demand-add">Create a post</a></li>
	</div>
	<div class="clear"></div>
	<div id="frame_demandTableDiv">
	  <form id="demandForm" enctype="multipart/form-data" name="demandForm" action="adminb<?=CHOSING_DE?>demand<?=CHOSING_DE?>doedit?itemid=<?=$this->itemArray[0]['itemid']?>" method="post">
		  <table width="100%" border="0" cellspacing="0" cellpadding="0"  >
			<tr>
			  <td height="27" colspan="2" valign="bottom" class="le no4">Edit Your Want It Now post with more specific details about what you are looking for.Learn more about Want It Now...</td>
			  <td width="27%" class="tdbg le no2">Important Posting tips</td>
			</tr>
			<tr>
			  <td colspan="2" class="le no4">&nbsp;</td>
			  <td rowspan="11" valign="top" class="no3 le">
			  <li>Try to be very specific in Want It Now post,adn you'll be more likely to find what you want</li><br />
			  <li>Don't include any contact information in your post(phone number,etc...).DHgate will automatically email you if a seller responds.</li>
			  <br />
			  <li>Don't list iterns you are selling.Want It Now is only for buyers seeking DHgate items.</li>
			  <br />
			  <a href="#">View Want It Now policies      </a></td>
			</tr>
			<tr>
			  <td width="18%" height="65" valign="top" class="ri no3"><strong>I am searching for</strong></td>
			  <td width="55%" height="65" valign="top" class="le no4"><label>
				<input type="text" name="subject" id="subject" value="<?=$this->itemArray[0]['subject']?>" />
				<br />
				<strong>Tip</strong>:Be specific.Think of words sellers might use to searching for your post.100 characters</label></td>
			</tr>
			<tr>
			  <td height="30"  class="no3 ri"><strong>Category</strong><input type="hidden" value="<?=$this->itemArray[0]['flid']?>" name="flid" id="flid" /></td>
			  <td height="30" class="le no4">
				<?=$this->selectString?>
			  </td>
			</tr>
			<tr>
			  <td height="30" valign="top"  class="no3 ri"><strong>Describe it in more detail</strong></td>
			  <td height="30" class="le no4"><label>
				<textarea name="demand_content" id="demand_content" cols="45" rows="5"><?=$this->itemArray[0]['content']?></textarea>
				<br /><span>498</span> characters</label></td>
			</tr>
			<tr>
			  <td height="50"  class="ri no3"><strong>Picture</strong></td>
			  <td valign="top" class="le no4">
				<span><input name="productpic" type="file" id="productpic" /></span>　<input type="button" onclick="demandUpload.uploadimg(this);" value="upload" />
			  </td>
			</tr>
			<tr>
			  <td height="50"  class="ri no3"><strong>Images</strong></td>
			  <td valign="top" class="le no4">
					<div id="productImages">
						<?for($i=0;$i<count($this->attachmentArray);$i++):?>
						<div style="margin:5px"><a href="<?=$this->attachmentArray[$i]['attachment_url']?>" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;border:1px #cccccc dashed" src="<?=$this->attachmentArray[$i]['attachment_url']?>" /></a>　Intro.: <input type="text" name="imgIntro[]" value="<?=$this->attachmentArray[$i]['intro']?>" /><input type="hidden" name="imgUrl[]" value="<?=$this->attachmentArray[$i]['attachment_url']?>" />　<input type="button" value="Delete" onclick="demandUpload.delimgbyid(this);" /><input type="hidden" value="<?=$this->attachmentArray[$i]['attachmentid']?>" name="attachmentid[]" /></div>
						<?endfor;?>
					</div>
					<iframe id="productIframe" width="0" height="0" name="productIframe"></iframe>
			  </td>
			</tr>			  
			<tr>
			  <td height="30"  class="ri no3"><strong>Select duration or your post</strong></td>
			  <td height="30" class="le no4">
				  <label>
					<select name="duration" style="width:50px">
						<option value="30" >30</option>
						<option value="45" >45</option>
					</select>
					days
				  </label>
			  </td>
			</tr>
			<tr>
			  <td height="30"  class="ri no3">&nbsp;</td>
			  <td height="30" class="le no4">&nbsp;</td>
			</tr>
			<tr>
			  <td height="30" class="ri no3">&nbsp;</td>
			  <td height="30" class="le no4" ><input type="image" src="html/images/adminb/post.gif" onclick="return checkForm();"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a onclick="commonEffection.confirmBack()">Cancel</a></td>
			  </tr>
			<tr>
			  <td height="30" colspan="2" class="ri no4">&nbsp;</td>
			  </tr>
		  </table>
	  </form>
	</div>
</div>